#!/usr/bin/python3
#################################################################################
#    发送SWD测试包，并用示波器观察波形                                          #
#    Copyright (C) 2021 Xu Ruijun                                               #
#                                                                               #
#    This program is free software; you can redistribute it and/or modify       #
#    it under the terms of the GNU General Public License as published by       #
#    the Free Software Foundation; either version 2 of the License, or          #
#    any later version.                                                         #
#                                                                               #
#    This program is distributed in the hope that it will be useful,            #
#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
#    GNU General Public License for more details.                               #
#                                                                               #
#    You should have received a copy of the GNU General Public License along    #
#    with this program; if not, write to the Free Software Foundation, Inc.,    #
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                #
#################################################################################

from wlink import ep_w1, ep_r1
import time

if __name__ == '__main__':
    for i in range(100000):
        ep_w1.write(b'\x81\x08\x06\x00\x00\x00\x00\x00\x00')
        print(ep_r1.read(9))
        time.sleep(0.01)
